The DDM Package
			
Introduction

This Demo contains two binaries which are used with the driverkit's DDM facility. ("DDM" stands for Driverkit Debugging Module). The two binaries are a kernel-loadable server, which is loaded into the kernel in which your driver is running, and an App called DDMViewer. DDMViewer allows to you manipulate the IODDMMasks variables in the kernel, allowing you to selectively enable and disable individual DDM event. It also lets you examine the DDM log iteself. 

The DDMViewer App

DDMViewer enables you to look at DDM traces at user level, in a scrollview. DDMViewer also lets you specify DDM mask bits via an array of radio buttons with labels like "SCSI Disk" and "Ethernet Rx". DDMViewer can be run on any machine, not just the machine being tested. 

The App is installed in /NextDeveloper/Demos/DDM/DDMViewer.app. 

Here's a brief tutorial on using the App:

    Device Name field - the name of the target to which you want to 
    	attach. For kernel debugging, the name is ddmServer. For user
	level drivers, the name is determined by the driver. 
	
    Host Name field - the name of the host on which the target is 
    	running. Leave empty if the debuggee is on the current machine.
	
    List button - start displaying DDM trace info, starting from the 
    	last event in time and scrolling backwards. Click again to stop.
	
    Set Mask button - send the mask defined in the Mask window (see
    	below) to the target.
	
    Disable button - freeze the state of the DDM buffer at the target. 
    	Click again to re-enable.
	
    Clear Window button - clear scrollview.
    
    Clear Buffer button - clear the target's circular DDM buffer.
    
    Mask Window
    
    	This lets you specify the value of the IODDMMasks words by name.
	The names of the mask bits are specified in an ASCII file, a 
	sample of which looks like this:
	
	#
	#  DDMViewer data file for Sample Driver.
	#
	Index : 0 : "Sample Driver"
	#
	#  Common fields.
	#
	0x0001 : "Input packets"
	0x0002 : "Output Packets"

	And so on. Comments start with '#'. The line which starts with 
	"Index" defines which IODDMMasks word is being defined (there are 
	currently 4 words of mask bits in i386 kernels, only 1 in the 
	m68k kernel). The Index line also defines the name of the 
	window associated with this set of mask bits. All other lines
	define one bit in the mask word, by specifying the value of the
	bit and an ASCII name which will be displayed in the Mask window. 
	
	This information is stored in a file with extension ".ddm" and
	is accessed in DDMViewer by opening a file via the Document menu. 

The kernel server

To access DDM data in the kernel, you must load in a loadable kernel server into the kernel to be tested. A kern-loadable binary can be found in /NextDeveloper/Demos/DDM/ddmServer_reloc.
	
To load the server into the kernel, just cd to the directory containing the server, su to root, and type
	
	# kl_util -a ddmServer_reloc
	
It takes up to a minute to load the thing; be patient. When you get a prompt back, you're ready to run DDMViewer.